<?php 
$flag=0;
// print_r($type);
 if($type=="edit")
 {
 	//print_r($infoclient);
 	
 	 if($type=="edit" && count($infoclient) ==1) $flag=1;
 }
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/text.css" />
<link rel="stylesheet" href="css/960_24_col.css" />
 <link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css" />
 <link rel="stylesheet" href="css/style.css" />
 <link rel="stylesheet" href="css/faary.css" type="text/css" />
 <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
 <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script>
<script>
	$(function(){
$(".formbus").validate({
		submitHandler: function(form){ form.submit() },
		 onfocusout: true,

		rules: {
			
		companyname: {required: true},
		
			
		address: {required: true},

		
		city: { required: true},	
			  		
		tele: {
				required: true,
		     	//telphone:true
				
				  },	
	fax: {
		required: true,
		
			
		 },				  
	contactperson:{required: true}	,			  	
		},  
		messages: {
			companyname: " Nom complet",
			address: "ajoutez l'adresse",
			city: "ajoutez la ville",
			tele: "ajouter Telephone xxx-xxx-xxxx",
			fax: "Ajouter le celluaire",
			contactperson:"ajouter le contact personal"
		}
	});
	})
</script>
</head>

<body>
	<script type="text/javascript">
<!--
	function isEmailValid(email){
		var e = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		return e.test(email);
	}
	
-->
</script>
	<div class="principal container_24">
		
		<!--logo-->
		<div class="logo grid_24">
			<div class="grid_1">&nbsp;</div>
			<div class="grid_4 logoimage">LOGO</div>
			<div class="logout grid_5"><a href="index.php?loginprocess/loginout"><img src="img/bt_logout.jpg"/></a></div>
		</div><!-- end logo-->
		
		<!--menupricipal-->
		<div class="menuprincipal grid_24">
			<a  style="color" href="index.php?gclient/listclient" >Allez à la List des Clients</a>
		</div>
		<!-- end menupricipal-->
				
			<div class="descprincipal grid_22">
				description
			</div>
			
			<div class="grid_24 listcontent">
				<h1>Booking Virtuo</h1>
				<div class="grid_22 list">
				
	<?php  if($flag ==1) {?>
		<form method="post" action="index.php?gclient/submiteditclient"  class="iform grid_18 formbus"  onSubmit="return false">
	<?php }else{?>			
		<form method="post" action="index.php?gclient/addclientinfo"  class="iform grid_18 formbus"  onSubmit="return false">
	<?php }?>	
 <?php if($flag ==1)
 		{
  ?>
 	<input type="hidden" name="idclients" value="<?php echo $infoclient[0]["idclients"]; ?>">
  <?php 			
 		}
 ?>
<div id="imessageOK">Thank you! Message Sent!</div>
<div id="imessageERROR">ERROR: Message Not Sent!</div>
<ul class="">
<li class="iheader">Ajouter L'infomation de client</li>
<li>
<label for="TourCode">*Nom de l'entreprise</label>
<input class="itext" type="text" name="companyname" id="companyname"  value="<?php  if($flag ==1){ echo $infoclient[0]["companyname"];}?>"/>
</li>

<li>
<label for="TourName">*Adresse</label>
<input class="itext" type="text" name="address" id="address" value="<?php  if($flag ==1){ echo $infoclient[0]["address"];}?>"/>
</li>

<li>
<label for="TourCode">*Ville</label>
<input class="itext" type="text" name="city" id="city"  value="<?php  if($flag ==1){ echo $infoclient[0]["city"];}?>"/>
</li>

<li>
<label for="TourCode">*Téléphone</label>
<input class="itext" type="text" name="tele" id="tele" value="<?php  if($flag ==1){ echo $infoclient[0]["tele"];}?>"/>
</li>

<li>
<label for="TourCode">*Celluaire</label>
<input class="itext" type="text" name="fax" id="TourCode" value="<?php  if($flag ==1){ echo $infoclient[0]["fax"];}?>"/>
</li>

<li>
<label for="TourCode">*La Personne de Contact </label>
<input class="itext" type="text" name="contactperson" id="contactperson" value="<?php  if($flag ==1){ echo $infoclient[0]["contactperson"];}?>"/>
</li>
<li>
<label for="TourCode">*Contact Email</label>
<input class="itext" type="text" name="contactpersonemail" id="contactpersonemail" value="<?php  if($flag ==1){ echo $infoclient[0]["contactpersonemail"];}?>"/>
</li>
<li><label>&nbsp;</label><input type="submit" class="ibutton"  name="SendaMessage" id="SendaMessage" value="Submit" /></li>
</ul></form>
</div>
</div>
		
	</div><!--end principal-->
</body>
</html>